1. Field of Invention
The invention relates to an error diffusion that generates multilevel output image data having fewer levels than multilevel input image data.
2. Description of Related Art
Conventionally, the error diffusion is known as a technique to generate multilevel output image data (e.g. bi-level output image data) from multilevel input image data, wherein the output image data has fewer levels than the input image data. The error diffusion of binarizing 256 levels input image data will be briefly described below.
First, a density I of a pixel to be processed (a subject pixel) of input image data is modified to obtain a modified density I′, with the addition of binary conversion errors e distributed to pixels located in a neighborhood of the subject pixel. More specifically, a binary conversion error e, for a pixel on which a binarization has been performed and caused at the pixel by the binarization, is stored. The binary conversion errors e are added to the subject pixel density I, according to the positions of the neighboring pixels with respect to the subject pixel. Percentages of the binary conversion errors e to be added to the subject pixel density I are determined based on an error distribution matrix as shown in FIG. 19. In the error distribution matrix of FIG. 19, each numeric value represents a weight coefficient according to a position of each neighboring pixel with respect to a subject pixel (*). In accordance with the error distribution matrix, as to each neighboring pixel of the subject pixel, its binary conversion error e is multiplied by a weight coefficient corresponding to the neighboring pixel. The obtained values are then added to the subject pixel density I to obtain a modified density I′ of the subject pixel.
Then, the obtained modified density I′ and a predetermined fixed threshold value T (e.g. T=128) are compared with each other. As a result of the comparison, when the modified density I′ is greater than or equal to the fixed threshold value T, an output density O is set to 255. When the modified density I′ is below the fixed threshold value T, the output density O is set to zero (0).
Then, the difference between the modified density I′ and the output density O is stored as a binary conversion error e of the pixel. By performing the above process on each pixel of the input image data, bi-level output image data is generated.